<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen: Eigen::Tridiagonalization&lt; MatrixType_ &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classEigen_1_1Tridiagonalization.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="classEigen_1_1Tridiagonalization-members.html">List of all members</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Eigen::Tridiagonalization&lt; MatrixType_ &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__DenseLinearSolvers__chapter.html">Dense linear problems and decompositions</a> &raquo; <a class="el" href="group__DenseLinearSolvers__Reference.html">Reference</a> &raquo; <a class="el" href="group__Eigenvalues__Module.html">Eigenvalues module</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename MatrixType_&gt;<br />
class Eigen::Tridiagonalization&lt; MatrixType_ &gt;</h3>

<p>Tridiagonal decomposition of a selfadjoint matrix. </p>
<p>This is defined in the Eigenvalues module.</p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Eigen/Eigenvalues&gt;</span> </div>
</div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">MatrixType_</td><td>the type of the matrix of which we are computing the tridiagonal decomposition; this is expected to be an instantiation of the <a class="el" href="classEigen_1_1Matrix.html" title="The matrix class, also used for vectors and row-vectors.">Matrix</a> class template.</td></tr>
  </table>
  </dd>
</dl>
<p>This class performs a tridiagonal decomposition of a selfadjoint matrix \( A \) such that: \( A = Q T Q^* \) where \( Q \) is unitary and \( T \) a real symmetric tridiagonal matrix.</p>
<p>A tridiagonal matrix is a matrix which has nonzero elements only on the main diagonal and the first diagonal below and above it. The Hessenberg decomposition of a selfadjoint matrix is in fact a tridiagonal decomposition. This class is used in <a class="el" href="classEigen_1_1SelfAdjointEigenSolver.html" title="Computes eigenvalues and eigenvectors of selfadjoint matrices.">SelfAdjointEigenSolver</a> to compute the eigenvalues and eigenvectors of a selfadjoint matrix.</p>
<p>Call the function <a class="el" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac" title="Computes tridiagonal decomposition of given matrix.">compute()</a> to compute the tridiagonal decomposition of a given matrix. Alternatively, you can use the Tridiagonalization(const MatrixType&amp;) constructor which computes the tridiagonal Schur decomposition at construction time. Once the decomposition is computed, you can use the <a class="el" href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc" title="Returns the unitary matrix Q in the decomposition.">matrixQ()</a> and <a class="el" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345" title="Returns an expression of the tridiagonal matrix T in the decomposition.">matrixT()</a> functions to retrieve the matrices Q and T in the decomposition.</p>
<p>The documentation of Tridiagonalization(const MatrixType&amp;) contains an example of the typical use of this class.</p>
<dl class="section see"><dt>See also</dt><dd>class <a class="el" href="classEigen_1_1HessenbergDecomposition.html" title="Reduces a square matrix to Hessenberg form by an orthogonal similarity transformation.">HessenbergDecomposition</a>, class <a class="el" href="classEigen_1_1SelfAdjointEigenSolver.html" title="Computes eigenvalues and eigenvectors of selfadjoint matrices.">SelfAdjointEigenSolver</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ac8b3065cc11b1c08e74649d4cd53dab0"><td class="memItemLeft" align="right" valign="top"><a id="ac8b3065cc11b1c08e74649d4cd53dab0"></a>
typedef <a class="el" href="classEigen_1_1HouseholderSequence.html">HouseholderSequence</a>&lt; <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a>, internal::remove_all_t&lt; typename CoeffVectorType::ConjugateReturnType &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">HouseholderSequenceType</a></td></tr>
<tr class="memdesc:ac8b3065cc11b1c08e74649d4cd53dab0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return type of <a class="el" href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc" title="Returns the unitary matrix Q in the decomposition.">matrixQ()</a> <br /></td></tr>
<tr class="separator:ac8b3065cc11b1c08e74649d4cd53dab0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd806a9be5363077e01028f952c786a8"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Eigen::Index</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Index</a></td></tr>
<tr class="separator:afd806a9be5363077e01028f952c786a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ee270966d18659018688662253dca23"><td class="memItemLeft" align="right" valign="top"><a id="a3ee270966d18659018688662253dca23"></a>
typedef MatrixType_&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a></td></tr>
<tr class="memdesc:a3ee270966d18659018688662253dca23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Synonym for the template parameter <code>MatrixType_</code>. <br /></td></tr>
<tr class="separator:a3ee270966d18659018688662253dca23"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a54ada2bbc4b27c64c0264b72e8caaaac"><td class="memTemplParams" colspan="2">template&lt;typename InputType &gt; </td></tr>
<tr class="memitem:a54ada2bbc4b27c64c0264b72e8caaaac"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a> &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac">compute</a> (const <a class="el" href="structEigen_1_1EigenBase.html">EigenBase</a>&lt; InputType &gt; &amp;matrix)</td></tr>
<tr class="memdesc:a54ada2bbc4b27c64c0264b72e8caaaac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes tridiagonal decomposition of given matrix.  <a href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac">More...</a><br /></td></tr>
<tr class="separator:a54ada2bbc4b27c64c0264b72e8caaaac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b7ff4860aa6f7c0761b1059c012fd8e"><td class="memItemLeft" align="right" valign="top">DiagonalReturnType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e">diagonal</a> () const</td></tr>
<tr class="memdesc:a0b7ff4860aa6f7c0761b1059c012fd8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the diagonal of the tridiagonal matrix T in the decomposition.  <a href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e">More...</a><br /></td></tr>
<tr class="separator:a0b7ff4860aa6f7c0761b1059c012fd8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a682d43187b558a33825bdaa7f2337b32"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1Matrix.html">CoeffVectorType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32">householderCoefficients</a> () const</td></tr>
<tr class="memdesc:a682d43187b558a33825bdaa7f2337b32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the Householder coefficients.  <a href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32">More...</a><br /></td></tr>
<tr class="separator:a682d43187b558a33825bdaa7f2337b32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5c279c97cee574215ba3f3037e9fbbc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">HouseholderSequenceType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc">matrixQ</a> () const</td></tr>
<tr class="memdesc:ad5c279c97cee574215ba3f3037e9fbbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the unitary matrix Q in the decomposition.  <a href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc">More...</a><br /></td></tr>
<tr class="separator:ad5c279c97cee574215ba3f3037e9fbbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef08c38d78a60c3e8277081761a52345"><td class="memItemLeft" align="right" valign="top">MatrixTReturnType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345">matrixT</a> () const</td></tr>
<tr class="memdesc:aef08c38d78a60c3e8277081761a52345"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an expression of the tridiagonal matrix T in the decomposition.  <a href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345">More...</a><br /></td></tr>
<tr class="separator:aef08c38d78a60c3e8277081761a52345"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adba57aab0d3876a99092f20b0d0dbc2e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e">packedMatrix</a> () const</td></tr>
<tr class="memdesc:adba57aab0d3876a99092f20b0d0dbc2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the internal representation of the decomposition.  <a href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e">More...</a><br /></td></tr>
<tr class="separator:adba57aab0d3876a99092f20b0d0dbc2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac423dbb91157c159bdcb4b5a8371232e"><td class="memItemLeft" align="right" valign="top">SubDiagonalReturnType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e">subDiagonal</a> () const</td></tr>
<tr class="memdesc:ac423dbb91157c159bdcb4b5a8371232e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the subdiagonal of the tridiagonal matrix T in the decomposition.  <a href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e">More...</a><br /></td></tr>
<tr class="separator:ac423dbb91157c159bdcb4b5a8371232e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef97d3fd6892d66ba94ab83e206c1606"><td class="memTemplParams" colspan="2">template&lt;typename InputType &gt; </td></tr>
<tr class="memitem:aef97d3fd6892d66ba94ab83e206c1606"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#aef97d3fd6892d66ba94ab83e206c1606">Tridiagonalization</a> (const <a class="el" href="structEigen_1_1EigenBase.html">EigenBase</a>&lt; InputType &gt; &amp;matrix)</td></tr>
<tr class="memdesc:aef97d3fd6892d66ba94ab83e206c1606"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor; computes tridiagonal decomposition of given matrix.  <a href="classEigen_1_1Tridiagonalization.html#aef97d3fd6892d66ba94ab83e206c1606">More...</a><br /></td></tr>
<tr class="separator:aef97d3fd6892d66ba94ab83e206c1606"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a009d14f8e6e964f35560b3f339aac87a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tridiagonalization.html#a009d14f8e6e964f35560b3f339aac87a">Tridiagonalization</a> (<a class="el" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Index</a> size=Size==<a class="el" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a> ? 2 :Size)</td></tr>
<tr class="memdesc:a009d14f8e6e964f35560b3f339aac87a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="classEigen_1_1Tridiagonalization.html#a009d14f8e6e964f35560b3f339aac87a">More...</a><br /></td></tr>
<tr class="separator:a009d14f8e6e964f35560b3f339aac87a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Typedef Documentation</h2>
<a id="afd806a9be5363077e01028f952c786a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd806a9be5363077e01028f952c786a8">&#9670;&nbsp;</a></span>Index</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Eigen::Index</a> <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::<a class="el" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Index</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000020">Deprecated:</a></b></dt><dd>since <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library.">Eigen</a> 3.3 </dd></dl>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a009d14f8e6e964f35560b3f339aac87a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a009d14f8e6e964f35560b3f339aac87a">&#9670;&nbsp;</a></span>Tridiagonalization() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::<a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Index</a>&#160;</td>
          <td class="paramname"><em>size</em> = <code>Size==<a class="el" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a>&#160;?&#160;2&#160;:&#160;Size</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Default constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Positive integer, size of the matrix whose tridiagonal decomposition will be computed.</td></tr>
  </table>
  </dd>
</dl>
<p>The default constructor is useful in cases in which the user intends to perform decompositions via <a class="el" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac" title="Computes tridiagonal decomposition of given matrix.">compute()</a>. The <code>size</code> parameter is only used as a hint. It is not an error to give a wrong <code>size</code>, but it may impair performance.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac" title="Computes tridiagonal decomposition of given matrix.">compute()</a> for an example. </dd></dl>

</div>
</div>
<a id="aef97d3fd6892d66ba94ab83e206c1606"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef97d3fd6892d66ba94ab83e206c1606">&#9670;&nbsp;</a></span>Tridiagonalization() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<div class="memtemplate">
template&lt;typename InputType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::<a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structEigen_1_1EigenBase.html">EigenBase</a>&lt; InputType &gt; &amp;&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor; computes tridiagonal decomposition of given matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">matrix</td><td>Selfadjoint matrix whose tridiagonal decomposition is to be computed.</td></tr>
  </table>
  </dd>
</dl>
<p>This constructor calls <a class="el" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac" title="Computes tridiagonal decomposition of given matrix.">compute()</a> to compute the tridiagonal decomposition.</p>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga99b41a69f0bf64eadb63a97f357ab412">MatrixXd</a> X = <a class="code" href="classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">MatrixXd::Random</a>(5,5);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga99b41a69f0bf64eadb63a97f357ab412">MatrixXd</a> A = X + X.transpose();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;Here is a random symmetric 5x5 matrix:&quot;</span> &lt;&lt; endl &lt;&lt; A &lt;&lt; endl &lt;&lt; endl;</div>
<div class="line">Tridiagonalization&lt;MatrixXd&gt; triOfA(A);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga99b41a69f0bf64eadb63a97f357ab412">MatrixXd</a> Q = triOfA.matrixQ();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The orthogonal matrix Q is:&quot;</span> &lt;&lt; endl &lt;&lt; Q &lt;&lt; endl;</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga99b41a69f0bf64eadb63a97f357ab412">MatrixXd</a> T = triOfA.matrixT();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The tridiagonal matrix T is:&quot;</span> &lt;&lt; endl &lt;&lt; T &lt;&lt; endl &lt;&lt; endl;</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;Q * T * Q^T = &quot;</span> &lt;&lt; endl &lt;&lt; Q * T * Q.transpose() &lt;&lt; endl;</div>
<div class="ttc" id="aclassEigen_1_1DenseBase_html_ae814abb451b48ed872819192dc188c19"><div class="ttname"><a href="classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">Eigen::DenseBase::Random</a></div><div class="ttdeci">static const RandomReturnType Random()</div><div class="ttdef"><b>Definition:</b> Random.h:114</div></div>
<div class="ttc" id="agroup__matrixtypedefs_html_ga99b41a69f0bf64eadb63a97f357ab412"><div class="ttname"><a href="group__matrixtypedefs.html#ga99b41a69f0bf64eadb63a97f357ab412">Eigen::MatrixXd</a></div><div class="ttdeci">Matrix&lt; double, Dynamic, Dynamic &gt; MatrixXd</div><div class="ttdoc">Dynamic×Dynamic matrix of type double.</div><div class="ttdef"><b>Definition:</b> Matrix.h:501</div></div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">Here is a random symmetric 5x5 matrix:
  1.36 -0.816  0.521   1.43 -0.144
-0.816 -0.659  0.794 -0.173 -0.406
 0.521  0.794 -0.541  0.461  0.179
  1.43 -0.173  0.461  -1.43  0.822
-0.144 -0.406  0.179  0.822  -1.37

The orthogonal matrix Q is:
       1        0        0        0        0
       0   -0.471    0.127   -0.671   -0.558
       0    0.301   -0.195    0.437   -0.825
       0    0.825   0.0459   -0.563 -0.00872
       0  -0.0832   -0.971   -0.202   0.0922
The tridiagonal matrix T is:
  1.36   1.73      0      0      0
  1.73   -1.2 -0.966      0      0
     0 -0.966  -1.28  0.214      0
     0      0  0.214  -1.69  0.345
     0      0      0  0.345  0.164

Q * T * Q^T = 
  1.36 -0.816  0.521   1.43 -0.144
-0.816 -0.659  0.794 -0.173 -0.406
 0.521  0.794 -0.541  0.461  0.179
  1.43 -0.173  0.461  -1.43  0.822
-0.144 -0.406  0.179  0.822  -1.37
</pre> 
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a54ada2bbc4b27c64c0264b72e8caaaac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54ada2bbc4b27c64c0264b72e8caaaac">&#9670;&nbsp;</a></span>compute()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<div class="memtemplate">
template&lt;typename InputType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a>&amp; <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::compute </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structEigen_1_1EigenBase.html">EigenBase</a>&lt; InputType &gt; &amp;&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Computes tridiagonal decomposition of given matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">matrix</td><td>Selfadjoint matrix whose tridiagonal decomposition is to be computed. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to <code>*this</code> </dd></dl>
<p>The tridiagonal decomposition is computed by bringing the columns of the matrix successively in the required form using Householder reflections. The cost is \( 4n^3/3 \) flops, where \( n \) denotes the size of the given matrix.</p>
<p>This method reuses of the allocated data in the <a class="el" href="classEigen_1_1Tridiagonalization.html" title="Tridiagonal decomposition of a selfadjoint matrix.">Tridiagonalization</a> object, if the size of the matrix does not change.</p>
<p>Example: </p><div class="fragment"><div class="line">Tridiagonalization&lt;MatrixXf&gt; tri;</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga731599f782380312960376c43450eb48">MatrixXf</a> X = <a class="code" href="classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">MatrixXf::Random</a>(4,4);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga731599f782380312960376c43450eb48">MatrixXf</a> A = X + X.transpose();</div>
<div class="line">tri.compute(A);</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The matrix T in the tridiagonal decomposition of A is: &quot;</span> &lt;&lt; endl;</div>
<div class="line">cout &lt;&lt; tri.matrixT() &lt;&lt; endl;</div>
<div class="line">tri.compute(2*A); <span class="comment">// re-use tri to compute eigenvalues of 2A</span></div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The matrix T in the tridiagonal decomposition of 2A is: &quot;</span> &lt;&lt; endl;</div>
<div class="line">cout &lt;&lt; tri.matrixT() &lt;&lt; endl;</div>
<div class="ttc" id="agroup__matrixtypedefs_html_ga731599f782380312960376c43450eb48"><div class="ttname"><a href="group__matrixtypedefs.html#ga731599f782380312960376c43450eb48">Eigen::MatrixXf</a></div><div class="ttdeci">Matrix&lt; float, Dynamic, Dynamic &gt; MatrixXf</div><div class="ttdoc">Dynamic×Dynamic matrix of type float.</div><div class="ttdef"><b>Definition:</b> Matrix.h:500</div></div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">The matrix T in the tridiagonal decomposition of A is: 
  1.36 -0.704      0      0
-0.704 0.0147   1.71      0
     0   1.71  0.856  0.641
     0      0  0.641 -0.506
The matrix T in the tridiagonal decomposition of 2A is: 
  2.72  -1.41      0      0
 -1.41 0.0294   3.43      0
     0   3.43   1.71   1.28
     0      0   1.28  -1.01
</pre> 
</div>
</div>
<a id="a0b7ff4860aa6f7c0761b1059c012fd8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b7ff4860aa6f7c0761b1059c012fd8e">&#9670;&nbsp;</a></span>diagonal()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a>&lt; <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a> &gt;::DiagonalReturnType <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a> &gt;::diagonal</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the diagonal of the tridiagonal matrix T in the decomposition. </p>
<dl class="section return"><dt>Returns</dt><dd>expression representing the diagonal of T</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Either the constructor Tridiagonalization(const MatrixType&amp;) or the member function compute(const MatrixType&amp;) has been called before to compute the tridiagonal decomposition of a matrix.</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#gaadf0b25f5437fbddaf84324419418be8">MatrixXcd</a> X = <a class="code" href="classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">MatrixXcd::Random</a>(4,4);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#gaadf0b25f5437fbddaf84324419418be8">MatrixXcd</a> A = X + X.adjoint();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;Here is a random self-adjoint 4x4 matrix:&quot;</span> &lt;&lt; endl &lt;&lt; A &lt;&lt; endl &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">Tridiagonalization&lt;MatrixXcd&gt; triOfA(A);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga99b41a69f0bf64eadb63a97f357ab412">MatrixXd</a> T = triOfA.matrixT();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The tridiagonal matrix T is:&quot;</span> &lt;&lt; endl &lt;&lt; T &lt;&lt; endl &lt;&lt; endl;</div>
<div class="line"> </div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;We can also extract the diagonals of T directly ...&quot;</span> &lt;&lt; endl;</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga8554c6170729f01c7572574837ecf618">VectorXd</a> diag = triOfA.diagonal();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The diagonal is:&quot;</span> &lt;&lt; endl &lt;&lt; diag &lt;&lt; endl; </div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga8554c6170729f01c7572574837ecf618">VectorXd</a> subdiag = triOfA.subDiagonal();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The subdiagonal is:&quot;</span> &lt;&lt; endl &lt;&lt; subdiag &lt;&lt; endl;</div>
<div class="ttc" id="agroup__matrixtypedefs_html_ga8554c6170729f01c7572574837ecf618"><div class="ttname"><a href="group__matrixtypedefs.html#ga8554c6170729f01c7572574837ecf618">Eigen::VectorXd</a></div><div class="ttdeci">Matrix&lt; double, Dynamic, 1 &gt; VectorXd</div><div class="ttdoc">Dynamic×1 vector of type double.</div><div class="ttdef"><b>Definition:</b> Matrix.h:501</div></div>
<div class="ttc" id="agroup__matrixtypedefs_html_gaadf0b25f5437fbddaf84324419418be8"><div class="ttname"><a href="group__matrixtypedefs.html#gaadf0b25f5437fbddaf84324419418be8">Eigen::MatrixXcd</a></div><div class="ttdeci">Matrix&lt; std::complex&lt; double &gt;, Dynamic, Dynamic &gt; MatrixXcd</div><div class="ttdoc">Dynamic×Dynamic matrix of type std::complex&lt;double&gt;.</div><div class="ttdef"><b>Definition:</b> Matrix.h:503</div></div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">Here is a random self-adjoint 4x4 matrix:
    (-0.422,0)  (0.705,-1.01) (-0.17,-0.552) (0.338,-0.357)
  (0.705,1.01)      (0.515,0) (0.241,-0.446)   (0.05,-1.64)
 (-0.17,0.552)  (0.241,0.446)      (-1.03,0)  (0.0449,1.72)
 (0.338,0.357)    (0.05,1.64) (0.0449,-1.72)       (1.36,0)

The tridiagonal matrix T is:
-0.422  -1.45      0      0
 -1.45   1.01  -1.42      0
     0  -1.42    1.8   -1.2
     0      0   -1.2  -1.96

We can also extract the diagonals of T directly ...
The diagonal is:
-0.422
  1.01
   1.8
 -1.96
The subdiagonal is:
-1.45
-1.42
 -1.2
</pre><dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345" title="Returns an expression of the tridiagonal matrix T in the decomposition.">matrixT()</a>, <a class="el" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e" title="Returns the subdiagonal of the tridiagonal matrix T in the decomposition.">subDiagonal()</a> </dd></dl>

</div>
</div>
<a id="a682d43187b558a33825bdaa7f2337b32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a682d43187b558a33825bdaa7f2337b32">&#9670;&nbsp;</a></span>householderCoefficients()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Matrix.html">CoeffVectorType</a> <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::householderCoefficients </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the Householder coefficients. </p>
<dl class="section return"><dt>Returns</dt><dd>a const reference to the vector of Householder coefficients</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Either the constructor Tridiagonalization(const MatrixType&amp;) or the member function compute(const MatrixType&amp;) has been called before to compute the tridiagonal decomposition of a matrix.</dd></dl>
<p>The Householder coefficients allow the reconstruction of the matrix \( Q \) in the tridiagonal decomposition from the packed data.</p>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga31c5fac458c04196a36b36b5e51127ff">Matrix4d</a> X = <a class="code" href="classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">Matrix4d::Random</a>(4,4);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga31c5fac458c04196a36b36b5e51127ff">Matrix4d</a> A = X + X.transpose();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;Here is a random symmetric 4x4 matrix:&quot;</span> &lt;&lt; endl &lt;&lt; A &lt;&lt; endl;</div>
<div class="line">Tridiagonalization&lt;Matrix4d&gt; triOfA(A);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#gaabb0b4639dc0b48e691e02e95873b0f1">Vector3d</a> hc = triOfA.householderCoefficients();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The vector of Householder coefficients is:&quot;</span> &lt;&lt; endl &lt;&lt; hc &lt;&lt; endl;</div>
<div class="ttc" id="agroup__matrixtypedefs_html_ga31c5fac458c04196a36b36b5e51127ff"><div class="ttname"><a href="group__matrixtypedefs.html#ga31c5fac458c04196a36b36b5e51127ff">Eigen::Matrix4d</a></div><div class="ttdeci">Matrix&lt; double, 4, 4 &gt; Matrix4d</div><div class="ttdoc">4×4 matrix of type double.</div><div class="ttdef"><b>Definition:</b> Matrix.h:501</div></div>
<div class="ttc" id="agroup__matrixtypedefs_html_gaabb0b4639dc0b48e691e02e95873b0f1"><div class="ttname"><a href="group__matrixtypedefs.html#gaabb0b4639dc0b48e691e02e95873b0f1">Eigen::Vector3d</a></div><div class="ttdeci">Matrix&lt; double, 3, 1 &gt; Vector3d</div><div class="ttdoc">3×1 vector of type double.</div><div class="ttdef"><b>Definition:</b> Matrix.h:501</div></div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">Here is a random symmetric 4x4 matrix:
   1.36   0.612   0.122   0.326
  0.612   -1.21  -0.222   0.563
  0.122  -0.222 -0.0904    1.16
  0.326   0.563    1.16    1.66
The vector of Householder coefficients is:
1.87
1.24
   0
</pre><dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e" title="Returns the internal representation of the decomposition.">packedMatrix()</a>, <a class="el" href="group__Householder__Module.html">Householder module</a> </dd></dl>

</div>
</div>
<a id="ad5c279c97cee574215ba3f3037e9fbbc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5c279c97cee574215ba3f3037e9fbbc">&#9670;&nbsp;</a></span>matrixQ()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">HouseholderSequenceType</a> <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::matrixQ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the unitary matrix Q in the decomposition. </p>
<dl class="section return"><dt>Returns</dt><dd>object representing the matrix Q</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Either the constructor Tridiagonalization(const MatrixType&amp;) or the member function compute(const MatrixType&amp;) has been called before to compute the tridiagonal decomposition of a matrix.</dd></dl>
<p>This function returns a light-weight object of template class <a class="el" href="classEigen_1_1HouseholderSequence.html" title="Sequence of Householder reflections acting on subspaces with decreasing size.">HouseholderSequence</a>. You can either apply it directly to a matrix or you can convert it to a matrix of type <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23" title="Synonym for the template parameter MatrixType_.">MatrixType</a>.</p>
<dl class="section see"><dt>See also</dt><dd>Tridiagonalization(const MatrixType&amp;) for an example, <a class="el" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345" title="Returns an expression of the tridiagonal matrix T in the decomposition.">matrixT()</a>, class <a class="el" href="classEigen_1_1HouseholderSequence.html" title="Sequence of Householder reflections acting on subspaces with decreasing size.">HouseholderSequence</a> </dd></dl>

</div>
</div>
<a id="aef08c38d78a60c3e8277081761a52345"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef08c38d78a60c3e8277081761a52345">&#9670;&nbsp;</a></span>matrixT()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">MatrixTReturnType <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::matrixT </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns an expression of the tridiagonal matrix T in the decomposition. </p>
<dl class="section return"><dt>Returns</dt><dd>expression object representing the matrix T</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Either the constructor Tridiagonalization(const MatrixType&amp;) or the member function compute(const MatrixType&amp;) has been called before to compute the tridiagonal decomposition of a matrix.</dd></dl>
<p>Currently, this function can be used to extract the matrix T from internal data and copy it to a dense matrix object. In most cases, it may be sufficient to directly use the packed matrix or the vector expressions returned by <a class="el" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e" title="Returns the diagonal of the tridiagonal matrix T in the decomposition.">diagonal()</a> and <a class="el" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e" title="Returns the subdiagonal of the tridiagonal matrix T in the decomposition.">subDiagonal()</a> instead of creating a new dense copy matrix with this function.</p>
<dl class="section see"><dt>See also</dt><dd>Tridiagonalization(const MatrixType&amp;) for an example, <a class="el" href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc" title="Returns the unitary matrix Q in the decomposition.">matrixQ()</a>, <a class="el" href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e" title="Returns the internal representation of the decomposition.">packedMatrix()</a>, <a class="el" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e" title="Returns the diagonal of the tridiagonal matrix T in the decomposition.">diagonal()</a>, <a class="el" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e" title="Returns the subdiagonal of the tridiagonal matrix T in the decomposition.">subDiagonal()</a> </dd></dl>

</div>
</div>
<a id="adba57aab0d3876a99092f20b0d0dbc2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adba57aab0d3876a99092f20b0d0dbc2e">&#9670;&nbsp;</a></span>packedMatrix()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a>&amp; <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; MatrixType_ &gt;::packedMatrix </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the internal representation of the decomposition. </p>
<dl class="section return"><dt>Returns</dt><dd>a const reference to a matrix with the internal representation of the decomposition.</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Either the constructor Tridiagonalization(const MatrixType&amp;) or the member function compute(const MatrixType&amp;) has been called before to compute the tridiagonal decomposition of a matrix.</dd></dl>
<p>The returned matrix contains the following information:</p><ul>
<li>the strict upper triangular part is equal to the input matrix A.</li>
<li>the diagonal and lower sub-diagonal represent the real tridiagonal symmetric matrix T.</li>
<li>the rest of the lower part contains the Householder vectors that, combined with Householder coefficients returned by <a class="el" href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32" title="Returns the Householder coefficients.">householderCoefficients()</a>, allows to reconstruct the matrix Q as \( Q = H_{N-1} \ldots H_1 H_0 \). Here, the matrices \( H_i \) are the Householder transformations \( H_i = (I - h_i v_i v_i^T) \) where \( h_i \) is the \( i \)th Householder coefficient and \( v_i \) is the Householder vector defined by \( v_i = [ 0, \ldots, 0, 1, M(i+2,i), \ldots, M(N-1,i) ]^T \) with M the matrix returned by this function.</li>
</ul>
<p>See LAPACK for further details on this packed storage.</p>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga31c5fac458c04196a36b36b5e51127ff">Matrix4d</a> X = <a class="code" href="classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">Matrix4d::Random</a>(4,4);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga31c5fac458c04196a36b36b5e51127ff">Matrix4d</a> A = X + X.transpose();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;Here is a random symmetric 4x4 matrix:&quot;</span> &lt;&lt; endl &lt;&lt; A &lt;&lt; endl;</div>
<div class="line">Tridiagonalization&lt;Matrix4d&gt; triOfA(A);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga31c5fac458c04196a36b36b5e51127ff">Matrix4d</a> pm = triOfA.packedMatrix();</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The packed matrix M is:&quot;</span> &lt;&lt; endl &lt;&lt; pm &lt;&lt; endl;</div>
<div class="line">cout &lt;&lt; <span class="stringliteral">&quot;The diagonal and subdiagonal corresponds to the matrix T, which is:&quot;</span> </div>
<div class="line">     &lt;&lt; endl &lt;&lt; triOfA.matrixT() &lt;&lt; endl;</div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">Here is a random symmetric 4x4 matrix:
   1.36   0.612   0.122   0.326
  0.612   -1.21  -0.222   0.563
  0.122  -0.222 -0.0904    1.16
  0.326   0.563    1.16    1.66
The packed matrix M is:
  1.36  0.612  0.122  0.326
-0.704 0.0147 -0.222  0.563
0.0925   1.71  0.856   1.16
 0.248  0.785  0.641 -0.506
The diagonal and subdiagonal corresponds to the matrix T, which is:
  1.36 -0.704      0      0
-0.704 0.0147   1.71      0
     0   1.71  0.856  0.641
     0      0  0.641 -0.506
</pre><dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32" title="Returns the Householder coefficients.">householderCoefficients()</a> </dd></dl>

</div>
</div>
<a id="ac423dbb91157c159bdcb4b5a8371232e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac423dbb91157c159bdcb4b5a8371232e">&#9670;&nbsp;</a></span>subDiagonal()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a>&lt; <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a> &gt;::SubDiagonalReturnType <a class="el" href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a>&lt; <a class="el" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a> &gt;::subDiagonal</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the subdiagonal of the tridiagonal matrix T in the decomposition. </p>
<dl class="section return"><dt>Returns</dt><dd>expression representing the subdiagonal of T</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Either the constructor Tridiagonalization(const MatrixType&amp;) or the member function compute(const MatrixType&amp;) has been called before to compute the tridiagonal decomposition of a matrix.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e" title="Returns the diagonal of the tridiagonal matrix T in the decomposition.">diagonal()</a> for an example, <a class="el" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345" title="Returns an expression of the tridiagonal matrix T in the decomposition.">matrixT()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Tridiagonalization_8h_source.html">Tridiagonalization.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:07:56 for Eigen by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
